package com.sxt.study.luckymoney.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @author songj
 * @date 2019/7/23 17:50
 */
@Entity
@Table(name = "tbl_lucky_money")
@Data
@ApiModel(value = "lucky-money", description = "红包")
public class LuckyMoney implements Serializable {
    private static final long serialVersionUID = 1L;

    public LuckyMoney() {
    }

    public LuckyMoney(BigDecimal amount, String sender) {
        this.amount = amount;
        this.sender = sender;
    }

    @ApiModelProperty(value = "ID", name = "id")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ApiModelProperty(value = "金额", name = "amount")
    @Column(scale = 2)
    private BigDecimal amount;

    @ApiModelProperty(value = "发红包的人", name = "sender")
    @Column(length = 15)
    private String sender;

    @ApiModelProperty(value = "收红包的人", name = "consumer")
    @Column(length = 15)
    private String consumer;

}
